package org.ykh.service.property;

import lombok.Data;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConstructorBinding;
import org.springframework.boot.context.properties.bind.DefaultValue;

/**
 * @author ykh
 */
@ConfigurationProperties(prefix = "redisson")
@ConstructorBinding
@Getter
public class RedissonProperties{

    private final int connectionPoolSize;
    private final int connectionMinimumIdleSize;
    private final int pingConnectionInterval;

    public RedissonProperties( @DefaultValue("64")int connectionPoolSize,
                              @DefaultValue("10")int connectionMinimumIdleSize,
                              @DefaultValue("60000")int pingConnectionInterval) {
        this.connectionPoolSize = connectionPoolSize;
        this.connectionMinimumIdleSize = connectionMinimumIdleSize;
        this.pingConnectionInterval = pingConnectionInterval;
    }
}
